package offer_board.action;


import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import offer_board.db.BoardDAO;
import offer_board.db.BoardBean;

 public class BoardDetailAction implements Action {
	 public ActionForward execute(HttpServletRequest request,HttpServletResponse response) throws Exception{ 
		request.setCharacterEncoding("utf-8");
   		
		BoardDAO boarddao=new BoardDAO();
	   	BoardBean boarddata=new BoardBean();
	   	
		String product_num=request.getParameter("product_num");
		boarddata=boarddao.getDetail(product_num);
	   	
	   	if(boarddata==null){
	   		System.out.println("안됨");
	   		return null;
	   	}
	   	System.out.println("됨");
	   	System.out.println("num값" + product_num);
	   	
	   	request.setAttribute("boarddata", boarddata);
	   	ActionForward forward = new ActionForward();
	   	forward.setRedirect(false);
	   	forward.setPath("../shop_offer/view.jsp");
	   	return forward;

	 }
}